﻿<%@ Page Title="Quản lý quy tắc đề thi" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="frmQuyTacDe.aspx.cs" Inherits="NhanVien_frmQuyTacDe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="wrap">
        <h2>
            Thông tin quy tắc đề thi
            <asp:HyperLink ID="HyperLink2" runat="server" CssClass="node"
            NavigateUrl="~/Admin/frmAdTaoDeThi.aspx" BackColor="#F1F1F1" >Hủy bỏ</asp:HyperLink>
        </h2>
    </div>
    
    <div style="border: solid 1px #CCCCCC;">
    <table class="style1">
        <tr>
            <td>
                <asp:Label ID="Label1" runat="server" Text="Ma Quy Tac"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtMaQuyTac" runat="server" AutoPostBack="True" 
                    ontextchanged="txtMaQuyTac_TextChanged"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnThem" runat="server" onclick="btnThem_Click" Text="Them" CssClass="button"
                    Width="117px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="So luong cau hoi"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtSoluongCH" runat="server"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnSua" runat="server" onclick="btnSua_Click" Text="Sua" CssClass="button"
                    Width="117px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="Kho"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtKho" runat="server" AutoPostBack="True" 
                    ontextchanged="txtKho_TextChanged"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnXoa" runat="server" onclick="btnXoa_Click" Text="Xoa" CssClass="button"
                    Width="117px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label4" runat="server" Text="Trung binh"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtTrungbinh" runat="server" AutoPostBack="True" 
                    ontextchanged="txtTrungbinh_TextChanged"></asp:TextBox>
            </td>
            <td>
                <asp:Button ID="btnHuyThaotac" runat="server" onclick="btnHuyThaotac_Click" CssClass="button"
                    Text="Huy Thao Tac" Width="117px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label5" runat="server" Text="De"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtDe" runat="server" AutoPostBack="True" 
                    ontextchanged="txtDe_TextChanged"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Label6" runat="server" Text="Thời gian (Tính bằng phút)"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="DropDownList1" runat="server">
                    <asp:ListItem>45</asp:ListItem>
                    <asp:ListItem>60</asp:ListItem>
                    <asp:ListItem>90</asp:ListItem>
                    <asp:ListItem>120</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    </div>
    
    <div align="center" style="width:100%; border: solid 1px #CCCCCC;padding-top:7px; height:300px;  overflow:auto;">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="grvQTDe" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
            DataKeyNames="MaQT" DataSourceID="SqlDataSource1" ForeColor="#333333" 
            GridLines="None" onselectedindexchanged="grvQTDe_SelectedIndexChanged">
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <Columns>
                <asp:TemplateField HeaderText="" >
                <ItemTemplate>
                    <input name="MyRadioButton" type="radio"  style="width:35px;"
                                value='<%# Eval("MaQT") %>' />
                </ItemTemplate>
            </asp:TemplateField>
                <asp:BoundField DataField="MaQT" HeaderText="MaQT" ReadOnly="True" 
                    SortExpression="MaQT" />
                <asp:BoundField DataField="SoCH" HeaderText="SoCH" SortExpression="SoCH" />
                <asp:BoundField DataField="Kho" HeaderText="Kho" SortExpression="Kho" />
                <asp:BoundField DataField="TB" HeaderText="TB" SortExpression="TB" />
                <asp:BoundField DataField="De" HeaderText="De" SortExpression="De" />
                <asp:BoundField DataField="Thoigian" HeaderText="Thoigian" 
                    SortExpression="Thoigian" />
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="true" 
                            CommandName="MyDelete" ImageUrl="~/Images/cross.png" CommandArgument='<%#Eval("MaQT") %>'
                            Text="Delete" style="padding-left:10px; padding-right:10px;"/>
                        <ajaxToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" ID="lnkDelete_ModalPopupExtender"
                            runat="server" TargetControlID="ImageButton2" PopupControlID="DivDeleteConfirmation"
                            OkControlID="ButtonDeleleOkay" CancelControlID="ButtonDeleteCancel">
                        </ajaxToolkit:ModalPopupExtender>
                        
                        <ajaxToolkit:ConfirmButtonExtender ID="lnkDelete_ConfirmButtonExtender" runat="server" Enabled="True"
                            TargetControlID="ImageButton2" DisplayModalPopupID="lnkDelete_ModalPopupExtender">
                        </ajaxToolkit:ConfirmButtonExtender> 
                    </ItemTemplate>

                </asp:TemplateField>

            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TracNghiemTrucTuyenConnectionString %>" 
            SelectCommand="SELECT * FROM [tbl_QUYTACDETHI]"></asp:SqlDataSource>
            
        </ContentTemplate>
    </asp:UpdatePanel>
</div>

<%-- Bảng thông báo xóa dữ liệu--%>

        <asp:Panel runat="server" ID="DivDeleteConfirmation" Style="display: none;" class="modalBox">
        <div>
            <div class="popup_Titlebar" id="PopupHeader">
                <div class="TitlebarLeft">
                    Xóa dữ liệu</div>
                <div class="TitlebarRight" onclick="$get('ButtonDeleteCancel').click();">
                </div>
            </div>
            <div class="popup_Body">
                <p>Bạn có chắc chắn muốn xóa ? </p>
            </div>
            <div class="popup_Buttons">
                <input id="ButtonDeleleOkay" value="Okay" type="button" />
                <input id="ButtonDeleteCancel" value="Cancel" type="button" />
            </div>
        </div>
        </asp:Panel>

</asp:Content>

